package me.predatorray.xcollection.common;

import me.predatorray.xcollection.Check;
import me.predatorray.xcollection.Filter;
import me.predatorray.xcollection.Mapper;

public class FilterMapper<E> implements Mapper<E, Boolean> {

    private final Filter<E> filter;

    public FilterMapper(Filter<E> filter) {
        Check.isNotNull(filter, "filter must not be null");
        this.filter = filter;
    }

    @Override
    public Boolean map(E e) {
        return filter.filter(e);
    }
}
